package com.woniuxy.commons.service;

import com.woniuxy.commons.entity.Receivables;
import com.woniuxy.commons.interceptor.FeignOauth2RequestInterceptor;
import com.woniuxy.commons.request.ResponseResult;
import com.woniuxy.commons.vo.AddAddTimeToReceivablesVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(name = "receivables", path = "/receivables", contextId = "receivables",configuration = FeignOauth2RequestInterceptor.class)
public interface FeignReceivablesService {
    @GetMapping("/refund/{pno}")
    public ResponseResult<Boolean> refund(@PathVariable("pno") String pno);

    @PutMapping("/setAddTime")
    public ResponseResult<Boolean> setAddTime(@RequestBody AddAddTimeToReceivablesVo addAddTimeToReceivablesVo);

    @GetMapping("/findAllReceivablesByPno/{pno}")
    public ResponseResult<List<Receivables>> findAllReceivablesByPno(@PathVariable("pno") String pno);
}
